package com.tzinfo.tzt.activity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.assist.ImageScaleType;
import com.nostra13.universalimageloader.core.display.FadeInBitmapDisplayer;
import com.tzinfo.tzt.R;
import com.tzinfo.tzt.activity.view.TouchImageView;

/**
 * Created by tongwanglin on 14-1-3.
 */
public class HouseTypeImageVIewerActivity extends Activity {

    private TouchImageView imageView;
    private ImageLoader imageLoader = ImageLoader.getInstance();
    private DisplayImageOptions options;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.imageviewer);
        imageView=(TouchImageView)findViewById(R.id.image);
        imageView.setMaxZoom(5);
        Intent intent=getIntent();
        String imageUrl=intent.getStringExtra("url");

        options = new DisplayImageOptions.Builder()
                .showImageForEmptyUri(R.drawable.ic_empty)
                .showImageOnFail(R.drawable.ic_error)
                .resetViewBeforeLoading(true).cacheOnDisc(true)
                .imageScaleType(ImageScaleType.EXACTLY)
                .bitmapConfig(Bitmap.Config.RGB_565)
                .displayer(new FadeInBitmapDisplayer(300)).build();

        imageLoader.displayImage(imageUrl,imageView,options);
    }


}
